//判断手机是否安装了某个APP,如果安装了就打开，没安装就下载  
function openApp(){  
    var ua = window.navigator.userAgent.toLowerCase();  
    //微信  
    if(ua.match(/MicroMessenger/i) == 'micromessenger'){  
        // window.location.href='downLoadForPhone';
		$(".mask").show();
    }else{//非微信浏览器  
      
        if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {  
            var loadDateTime = new Date();  
            window.setTimeout(function() {  
                var timeOutDateTime = new Date();  
                if (timeOutDateTime - loadDateTime < 5000) {  
                    window.location = "https://itunes.apple.com/cn/app/%E8%83%BD%E8%B4%AD/id953741211?mt=8";//ios下载地址  

                } else {  
                window.close();  
                }  
            },2000);  
            window.location = "ng2018010401576323://";  
          }else if (navigator.userAgent.match(/android/i)) {  
            var state = null;  
            try {  
                window.location = 'ngclientweb://app';  
                setTimeout(function(){  
                    window.location= "http://d.365neng.com/com.nenggou.syn.apk"; //android下载地址  
                    
                },1000);  
            } catch(e) {}  
        }
    }  
}




/*判断是安卓还是ios*/
//function judgment(){
	//var u = navigator.userAgent;
//if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
  //openApp();
// window.location.href = "mobile/down.html";
//} else if (u.indexOf('iPhone') > -1) {//苹果手机
  //openApp();
// window.location.href = "mobile/down.html";
//} //else if (u.indexOf('Windows Phone') > -1) {//winphone手机

// window.location.href = "mobile/down.html";
//}
	//}